//详细事迹\简要事迹编辑通用工具(简易放大器)
function textUtil(id,titleName)
{
	  var w = screen.availWidth;
	  var h = screen.availHeight;
	  art.dialog.open(top.formateUrl("common/textExit.jsp?id="+id),{
		title:titleName,
		lock : true,
		fixed : true,
		width:w-100,
		height:h-250,
		ok: function () {
			var iframe = this.iframe.contentWindow;
			if(!iframe.document.body){
				art.dialog.tips("正在加载，请稍候...",1500);
				return false;
			}
			iframe.sub_form();
			return false;
		},
		cancel: true
	   });
}
/**
 * 限定textarea输入的长度
 */
$(function(){
	$(".textAreaLength").each(function(i,n){
		var arealength = $(this).val().length;
		var size = $(this).attr("length");
		$(this).css("overflow","auto");
		$(this).after("<div style='color:red;'>"+arealength+"/"+size+"</div>");
	});
	$(".textAreaLength").bind("keyup",function(){
		var size = $(this).attr("length");
		var length = $(this).val().length;
		if(length>=size){
			$(this).val($(this).val().substr(0,size));
			length=size;
		}
		$(this).next("div").html(length+"/"+size)
	})
});

/**
 * 限定textarea输入的长度
 */
$(function(){
	$(".areaLength").each(function(i,n){
		var arealength = $(this).val().length;
		var size = $(this).attr("length");
		$(this).css("overflow","auto");
		var width = $(this).css("width");
		width = width.substring(0,width.length-2);
		$(this).after("<div style='color:red;margin-top:-30px;margin-left:"+(width-50)+"px;'>"+arealength+"/"+size+"</div>");
	});
	$(".areaLength").bind("keyup",function(){
		var size = $(this).attr("length");
		var length = $(this).val().length;
		if(length>=size){
			$(this).val($(this).val().substr(0,size));
			length=size;
		}
		$(this).next("div").html(length+"/"+size)
	})
})

function selectaPoliceKind(){
	var url = top.formateUrl("common/policeKindSelect.jsp");
		win = art.dialog.open(url,{
			title:"选择警种",
			lock : true,
			width:740,
			height:290,
			fixed : true,
			resize:false,
			cancel: true
		});
} 